﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Runtime.InteropServices;
using System.IO;

namespace Web {

  public partial class System_IO_DriveInfo : System.Web.UI.Page {

    protected void Page_Load(object sender, EventArgs e) {

      if (!IsPostBack) {

        DriveInfo[] drives = null;

        drives = DriveInfo.GetDrives();

        foreach (DriveInfo item in drives) {

          Response.Write("Drive Name: " + item.Name + "<br />");
          Response.Write("Drive Type: " + item.DriveType + "<br />");

          if (item.IsReady) {

            Response.Write("Volume Label: " + item.VolumeLabel + "<br />");
            Response.Write("Drive Format: " + item.DriveFormat + "<br />");

            Response.Write("Available Free Space: " + item.AvailableFreeSpace + "<br />");
            Response.Write("Total Free Space: " + item.TotalFreeSpace + "<br />");
            Response.Write("Total Size: " + item.TotalSize + "<br /><br />");
          }
        }
      }
    }
  }
}